<!-- Generated automatically from an XML file of the same name.
     Copyright: Stephen J. Sangwine and Nicolas Le Bihan, 2008-2010.
--><html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>diff :: Functions (Quaternion Toolbox Function Reference)
</title><link rel="stylesheet" href="qtfmstyle.css" type="text/css"></head><body><h1>Quaternion Function Reference</h1><h2>diff</h2>
<p>Differences<br>(Quaternion overloading of standard MATLAB&reg; function)
</p>
<h2>Syntax</h2><p><tt>Z = diff(X, n, dim)</tt></p>
<h2>Description</h2>
<p>
<tt>diff(X, n, dim)</tt> computes the n-th differences between elements
of the quaternion array <tt>X</tt> along dimension <tt>dim</tt>, if
specified.
</p>

<h2>Examples</h2>
<pre>
&gt;&gt; A = randq(1,2)
 
A = 1x2 quaternion array
 
&gt;&gt; show(A)
 
A.S = -0.3782    0.0448

A.X = -0.2545    0.1962

A.Y = -0.7229   -0.3947

A.Z =  0.5192    0.8965

&gt;&gt; diff(A)
 
ans = 0.423 + 0.4507 * I + 0.3282 * J + 0.3773 * K
</pre>

<h2>See Also</h2>MATLAB&reg; function: <a href="matlab:doc diff">diff</a><br>QTFM functions: <a href="prod.html">prod</a>, <a href="sum.html">sum</a><br>
<h4>&copy; 2008-2010 Stephen J. Sangwine and Nicolas Le Bihan</h4><p><a href="license.html">License terms.</a></p></body></html>